/*!\file  critical.h  The atomic stuff.
 *
 *      This file is part of the micro-rtos package.
 *
 *  Copyright (c) 2008-2009 by 
		Gabriel Zabusek <gabriel.zabusek@gmail.com>
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      as published by the Free Software Foundation; either version
 *      2 of the License, or (at your option) any later version.
 */

#ifndef __CRITICAL_H
#define __CRITICAL_H

static inline void 
EnterCriticalSection(void)
{
	asm volatile("NOP");
}

static inline void
LeaveCriticalSection(void)
{
	asm volatile("NOP");
}

#define EnterUserMode_IRQE()   asm volatile("MSR     CPSR_c, #0x10\n")
#define EnterUserMode_IRQD()   asm volatile("MSR     CPSR_c, #0x10 | #0x80 | #0x40\n")
#define EnterKernelMode_IRQE() asm volatile("MSR     CPSR_c, #0x13")
#define EnterKernelMode_IRQD() asm volatile("MSR     CPSR_c, #0x13|#0x80|#0x40")

#endif
